home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.border;
-
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Graphics;
- import java.awt.Insets;
-
- public class LineBorder extends AbstractBorder {
- private static Border blackLine;
- private static Border grayLine;
- protected int thickness;
- protected Color lineColor;
- protected boolean roundedCorners;
-
- public LineBorder(Color var1) {
- this(var1, 1, false);
- }
-
- public LineBorder(Color var1, int var2) {
- this(var1, var2, false);
- }
-
- LineBorder(Color var1, int var2, boolean var3) {
- this.lineColor = var1;
- this.thickness = var2;
- this.roundedCorners = var3;
- }
-
- public static Border createBlackLineBorder() {
- if (blackLine == null) {
- blackLine = new LineBorder(Color.black, 1);
- }
-
- return blackLine;
- }
-
- public static Border createGrayLineBorder() {
- if (grayLine == null) {
- grayLine = new LineBorder(Color.gray, 1);
- }
-
- return grayLine;
- }
-
- public Insets getBorderInsets(Component var1) {
- return new Insets(this.thickness, this.thickness, this.thickness, this.thickness);
- }
-
- public Insets getBorderInsets(Component var1, Insets var2) {
- var2.left = var2.top = var2.right = var2.bottom = this.thickness;
- return var2;
- }
-
- public Color getLineColor() {
- return this.lineColor;
- }
-
- public int getThickness() {
- return this.thickness;
- }
-
- public boolean isBorderOpaque() {
- return true;
- }
-
- public void paintBorder(Component var1, Graphics var2, int var3, int var4, int var5, int var6) {
- Color var7 = var2.getColor();
- var2.setColor(this.lineColor);
-
- for(int var8 = 0; var8 < this.thickness; ++var8) {
- if (!this.roundedCorners) {
- var2.drawRect(var3 + var8, var4 + var8, var5 - var8 - var8 - 1, var6 - var8 - var8 - 1);
- } else {
- var2.drawRoundRect(var3 + var8, var4 + var8, var5 - var8 - var8 - 1, var6 - var8 - var8 - 1, this.thickness, this.thickness);
- }
- }
-
- var2.setColor(var7);
- }
- }
-